<?php

namespace app\api\controller;

use app\common\controller\Api;

class Water extends Api
{
    protected $noNeedLogin = [''];
    protected $noNeedRight = '*';

    public function info()
    {
        $param=$this->request->param();
        $user=$this->auth;
        if(empty($param['num'])){
            $num=$user->num;
        }else{
            $num=$param['num'];
        }
        $where['num']=$num;
        $find=Db::name('building')->where($where)->find();
        $find['quarter']=Db::name('waterrate')->where(['num'=>$find['num']])->order('id desc')->find();
        $this->success('',$find);
    }
}
